home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1286.dms / var1286.adf / printers / IBMColorJet / prtbase.h < prev    next >
C/C++ Source or Header  |  1992-09-02  |  5KB  |  144 lines

  1. /********************************************************************/
  2. /*               Commodore-Amiga, Inc.                              */
  3. /*               prtbase.h                                          */
  4. /********************************************************************/
  5. /*********************************************************************
  6.  *
  7.  * printer device data definition
  8.  *
  9.  ********************************************************************/
  10.  
  11. #ifndef  DEVICES_PRTBASE_H
  12. #define  DEVICES_PRTBASE_H
  13.  
  14.  
  15. #ifndef  EXEC_NODES_H
  16. #include "exec/nodes.h"
  17. #endif
  18. #ifndef  EXEC_LISTS_H
  19. #include "exec/lists.h"
  20. #endif
  21. #ifndef  EXEC_PORTS_H
  22. #include "exec/ports.h"
  23. #endif
  24. #ifndef  EXEC_LIBRARIES_H
  25. #include "exec/libraries.h"
  26. #endif
  27. #ifndef  EXEC_TASKS_H
  28. #include "exec/tasks.h"
  29. #endif
  30.  
  31. #ifndef  DEVICES_PARALLEL_H
  32. #include "devices/parallel.h"
  33. #endif
  34. #ifndef  DEVICES_SERIAL_H
  35. #include "devices/serial.h"
  36. #endif
  37. #ifndef  DEVICES_TIMER_H
  38. #include "devices/timer.h"
  39. #endif
  40. #ifndef  LIBRARIES_DOSEXTENS_I
  41. #include "libraries/dosextens.h"
  42. #endif
  43. #ifndef  INTUITION_INTUITION_H
  44. #include "intuition/intuition.h"
  45. #endif
  46.  
  47.  
  48. struct DeviceData {
  49.     struct Library dd_Device; /* standard library node */
  50.     APTR dd_Segment;          /* A0 when initialized */
  51.     APTR dd_ExecBase;         /* A6 for exec */
  52.     APTR dd_CmdVectors;       /* command table for device commands */
  53.     APTR dd_CmdBytes;         /* bytes describing which command queue */
  54.     UWORD   dd_NumCommands;   /* the number of commands supported */
  55. };
  56.  
  57.  
  58. #define  P_STKSIZE   0x800
  59.  
  60. struct   PrinterData {
  61.    struct   DeviceData pd_Device;
  62.    struct   MsgPort pd_Unit;  /* the one and only unit */
  63.    BPTR     pd_PrinterSegment;   /* the printer specific segment */
  64.    UWORD    pd_PrinterType;   /* the segment printer type */
  65.    struct   PrinterSegment *pd_SegmentData; /* the segment data structure */
  66.    UBYTE    *pd_PrintBuf;     /* the raster print buffer */
  67.    int      (*pd_PWrite)();   /* the write function */
  68.    int      (*pd_PBothReady)();  /* write function's done */
  69.    union {                    /* port I/O request 0 */
  70.    struct IOExtPar pd_p0;
  71.    struct IOExtSer pd_s0;
  72.     } pd_ior0;
  73. #define  pd_PIOR0 pd_ior0.pd_p0
  74. #define  pd_SIOR0 pd_ior0.pd_s0
  75.     union {                   /*   and 1 for double buffering */
  76.    struct IOExtPar pd_p1;
  77.    struct IOExtSer pd_s1;
  78.     } pd_ior1;
  79. #define  pd_PIOR1 pd_ior1.pd_p1
  80. #define  pd_SIOR1 pd_ior1.pd_s1
  81.     struct timerequest pd_TIOR;  /* timer I/O request */
  82.     struct MsgPort pd_IORPort;   /*   and message reply port */
  83.     struct Task pd_TC;           /* write task */
  84.     UBYTE pd_Stk[P_STKSIZE];     /*   and stack space */
  85.     UBYTE pd_Flags;              /* device flags */
  86.     UBYTE pd_pad;
  87.     struct Preferences pd_Preferences; /* the latest preferences */
  88.     UBYTE   pd_PWaitEnabled;     /* wait function switch */
  89. };
  90.  
  91. #define  PPCB_GFX 0
  92. #define  PPCF_GFX 0x01
  93. #define  PPCB_COLOR  1
  94. #define  PPCF_COLOR  0x02
  95.  
  96. #define  PPC_BWALPHA 0 /* black&white alphanumerics */
  97. #define  PPC_BWGFX   1 /* black&white graphics */
  98. #define  PPC_COLORGFX   3 /* color graphics */
  99.  
  100. #define    PCC_BW        1    /* only black&white */
  101. #define    PCC_YMC        2    /* only yellow/magenta/cyan */
  102. #define    PCC_YMC_BW    3    /* yellow/magenta/cyan or black&white */
  103. #define    PCC_YMCB    4    /* yellow/magenta/cyan/black */
  104.  
  105. #define    PCC_4COLOR    0x4    /* a flag for YMCB and BGRW */
  106. #define    PCC_ADDITIVE    0x8    /* not yellow/magenta/cyan/black, */
  107.                 /*   but blue/green/red/white */
  108. #define    PCC_WB        0x9    /* only black&white, 0 == BLACK */
  109. #define    PCC_BGR        0xa    /* blue/green/red */
  110. #define    PCC_BGR_WB    0xb    /* blue/green/red or black&white */
  111. #define    PCC_BGRW    0xc    /* blue/green/red/white */
  112.  
  113. struct PrinterExtendedData {
  114.     char    *ped_PrinterName;    /* printer name, null terminated */
  115.     VOID    (*ped_Init)();       /* called after LoadSeg */
  116.     VOID    (*ped_Expunge)();    /* called before UnLoadSeg */
  117.     int     (*ped_Open)();       /* called at OpenDevice */
  118.     VOID    (*ped_Close)();      /* called at CloseDevice */
  119.     UBYTE   ped_PrinterClass;    /* printer class */
  120.     UBYTE   ped_ColorClass;      /* color class */
  121.     UBYTE   ped_MaxColumns;      /* number of print columns available */
  122.     UBYTE   ped_NumCharSets;     /* number of character sets */
  123.     UWORD   ped_NumRows;         /* number of raster rows in a raster dump */
  124.     ULONG   ped_MaxXDots;        /* number of dots maximum in a raster dump */
  125.     ULONG   ped_MaxYDots;        /* number of dots maximum in a raster dump */
  126.     UWORD   ped_XDotsInch;       /* horizontal dot density */
  127.     UWORD   ped_YDotsInch;       /* vertical dot density */
  128.     char    ***ped_Commands;     /* printer text command table */
  129.     VOID    (*ped_DoSpecial)();  /* special command handler */
  130.     VOID    (*ped_Render)();     /* raster render function */
  131.     LONG    ped_TimeoutSecs;     /* good write timeout */
  132.     /* the following only exists if the segment version is 33 or greater */
  133.     char    **ped_8BitChars;     /* conversion strings for the extended font */
  134. };
  135.  
  136. struct PrinterSegment {
  137.     ULONG   ps_NextSegment;      /* (actually a BPTR) */
  138.     ULONG   ps_runAlert;         /* MOVEQ #0,D0 : RTS */
  139.     UWORD   ps_Version;          /* segment version */
  140.     UWORD   ps_Revision;         /* segment revision */
  141.     struct  PrinterExtendedData ps_PED;   /* printer extended data */
  142. };
  143. #endif
  144.